package com.example.mindadinner.net;

import java.io.IOException;
import java.io.Serializable;

import org.apache.http.client.ClientProtocolException;


public abstract class NetResponse implements Response,Serializable{

	  private static final long serialVersionUID = 1L;
	  private int error_code;

	  public int getErrorCode() {
	    return error_code;
	  }

	  /**
	   * Returns <code>true</code> if response success.
	   */
	  public boolean isSuccess() {
	    return error_code == ApiErrorCode.NO_ERROR.getErrorCode();
	  }
	  
	public abstract  <RES extends  NetResponse>  RES getResponseFromRequest(NetRequest request) throws ClientProtocolException, IOException;
}
